import space.jamestang.simpleci.config.ConfigChecker
import space.jamestang.simpleci.runner.Runner
import space.jamestang.simpleci.schema.Project
import kotlin.test.BeforeTest
import kotlin.test.Test

class RunnerTest {

    lateinit var runner: Runner

    @BeforeTest
    fun initialize(){

        ConfigChecker.check()

        val project = Project {
            id = 1
            name = "demo"
            description = "Test SimpleCI"
            gitUrl = "https://gitee.com/jamestangakajava9/demo.git"
            branch = "master"
            buildCommand = mapOf(
                "Init" to listOf("gradle", "clean"),
                "Build" to listOf("gradle", "build")
            )
        }

        runner = Runner.build(project, null)
    }


    @Test
    fun testBuild(){
        runner.run()
    }
}